<?php
$uid = $_POST['uid'];
$mode = $_POST['mode'];
include ("conn.php");
include ("findUser.php");
if($mode=="1"){
	$sql = "SELECT * FROM attention WHERE uid1=".(int)$uid;
	$result = $conn->query($sql);
	$mode2="uid2";
}else{
	$sql = "SELECT * FROM attention WHERE uid2=".(int)$uid;
	$result = $conn->query($sql);	
	$mode2="uid1";
}
$arr = array();
if ($result->num_rows > 0) {
	// 输出数据
    while($row = $result->fetch_assoc()) {
    	array_push($arr,findUser($row[$mode2]));
    }
}
echo json_encode($arr);
?>